/*
 * 过去店铺列表
 * @Author: zfx
 * @Date: 2018-09-14 17:38:08
 */
<style lang="less" rel="stylesheet/less" type="text/less">

	.v-customer-skin-detail-stores-index {
		.store_img {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            margin: auto;
            img {
                width: 100%;
                height: 100%;
            }
        }
	}

</style>
<template>
	<div class="v-customer-skin-detail-stores-index">

		<Table
			:columns="columns"
			:loading="loading"
			:height="tableHeight()"
			:data="goesStores"
			class="personal-scrollbar"/>

	</div>
</template>

<script>
import { computedTableHeight } from 'src/views/mixins/computedTableHeight';

export default {
	name: 'StoresIndex',
	mixins: [computedTableHeight],
	props: {
		loading: {
			type: Boolean,
			default() {
				return false;
			},
		},
		goesStores: {
			type: Array,
			default() {
				return [];
			},
		},
	},
	data() {
		return {
			columns: [
				{
					title: this.$t('report_detail.store_trademark'),
					key: 'store_img',
					align: 'center',
					render: (h, { row }) => {
						const img = row.store_img ? <img src={ row.store_img} alt="无" /> : this.$t('common.none');
						return (<div class="store_img">{ img }</div>);
					},
				},
				{
					title: this.$t('report_detail.store_name'),
					key: 'name',
					align: 'center',
					render: (h, { row }) => <div> { row.name || '-' } </div>,
				},
				{
					title: this.$t('report_detail.store_address'),
					key: 'address',
					align: 'center',
					render: (h, { row }) => <div> { row.address || '-' } </div>,
				},
				{
					title: this.$t('report_detail.img_test_count'),
					key: 'hm_skin_count',
					align: 'center',
					render: (h, { row }) => <div> { row.hm_skin_count || 0 } </div>,
				},
				{
					title: this.$t('report_detail.touch_test_count'),
					key: 'wax_skin_count',
					align: 'center',
					render: (h, { row }) => <div> { row.wax_skin_count || 0 } </div>,
				},
				{
					title: this.$t('report_detail.all_test_count'),
					key: 'all_skin_count',
					align: 'center',
					render: (h, { row }) => <div> { row.all_skin_count || 0 } </div>,
				},
			],
		};
	},
	methods: {

	},
};
</script>
